<?php
$title=___('Affiliate info');
$this->headLink()->appendStylesheet($this->_scriptCss('aff.css'));
$this->setLayout('member/layout.phtml');
?>
<!-- aff banners -->
<?php if (count($affBanners)) : ?>
<h2><?php __e('Banners and Links') ?></h2>
    <?php foreach ($affBanners as $banner) : ?>
<div class="aff-banner-preview">
    <dl>
        <dt><?php __e('Title') ?></dt>
        <dd><?php echo $this->escape($banner->title) ?></dd>
        <dt><?php __e('Target URL') ?></dt>
        <dd><a href="<?php echo $banner->url ?>"><?php echo $this->escape($banner->url) ?></a></dd>
                <?php if ($banner->desc) : ?>
        <dt><?php __e('Description') ?></dt>
        <dd><?php echo $this->escape($banner->desc) ?></dd>
                <?php endif; ?>
    </dl>
    <br /><br />
            <?php $bannerRenderer = Am_BannerRenderer::create($banner); ?>
            <?php if ($note = $bannerRenderer->getNote()) : ?>
    <div class="aff-banner-note">
                    <?php echo $note ?>
    </div>
            <?php endif; ?>
            <?php echo $bannerRenderer->getPreview(); ?>
    <br /><br />
    <p><?php __e('Source Code &mdash; Copy/Paste Into Your Website') ?></p>
    <textarea style="width:90%"><?php echo $this->escape($bannerRenderer->getPreview()); ?></textarea>
</div>
    <?php endforeach; ?>
<?php else: // no banners ?> 
<?php __e("No Banners and Links added by admin yet") ?>
<?php endif; ?>



<!-- aff downloads -->
<?php if (count($affDownloads)) : ?>
<h2><?php __e('Marketing Materials') ?></h2>
<ul>
    <?php foreach ($affDownloads as $download) : ?>
    <li><a href="<?php echo ROOT_URL . '/file/download/path/' . $download->getPath() ?>"><?php echo $this->escape($download->getName()) ?></a>
            <?php if ($download->desc) : ?>
        <br /><small><?php __e($download->desc) ?></small>
            <?php endif; ?>
    </li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>